<template>
    <div>
        <p :style="{color:'red'}">建哥最帅</p>
        <child></child>
    </div>
</template>
<script lang="ts">
import {defineComponent,  reactive,  ref ,  toRefs,toRaw,markRaw, toRef, customRef, provide, inject} from 'vue'
import child from "../src/components/Child-02.vue"

export default defineComponent({
    name:"建哥",
    components:{
        child
    },
    setup() {
        const color = ref('red')
        provide('color',color);//? 提供数据为孙级组件
        const a = inject("color");//? 注入color  这里面a此时是undefined
        
    },
})

</script>
